<template>
  <div id="swiper">
    <van-swipe class="my-swipe" :autoplay="2000" indicator-color="white">
      <van-swipe-item v-for="(item,index) in bannerlist" :key="index">
          <img :src="item.bannerUrl" alt="">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { banner } from "../../api";
export default {
  data() {
    return {
      bannerlist:[],
    };
  },
  mounted(){
    banner().then((res)=>{
      this.bannerlist = res.data.list;
    })
  }
};
</script>

<style scoped>
#swiper {
  width: 95%;
  margin: 10px auto;
  box-sizing: border-box;
  border-radius: 5px;
}
#swiper img {
  width: 100%;
}
</style>